package com.ytq.pratice;

/**
 * @author yuantongqin
 * @date 2018/9/28 下午4:47
 */
public class VClass {



   volatile static int i=0;

    public static void inre(){
        i++;//
    }


    public void ss(){
        synchronized (this){

            synchronized (this){
                System.out.println("b");
            }
            System.out.println("ss");
            try {
                Thread.sleep(20000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
    
    public static void main(String[] args) throws InterruptedException {
        for (int i=0;i<2;i++){

            new Thread(()->{
                try {
                    Thread.sleep(1);

                    new VClass().ss();

                    new VClass().ss();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                inre();
            }).start();


        }
//
//        Thread.sleep(1000);
//        System.out.println(i);

    }
}
